package com.me.springcloud.hystrix;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import rx.Observable;

public class HystrixMain {

	public static void main(String[] args) throws InterruptedException, ExecutionException, TimeoutException {
//		String s1 = new CommandHelloWorld("Bob").bl;
//		System.out.println(s1);
//		Future<String> s2 = new CommandHelloWorld("Bob").queue();
//		System.out.println(s2.get(5L, TimeUnit.SECONDS));
		Observable<String> s3 = new CommandHelloWorld2("Bob").observe();
		s3.subscribe(System.out::println);

		Future<String> fucure = s3.toBlocking().toFuture();
		
		new CommandHelloWorld("Bob").toObservable().subscribe(System.out::println);

		System.out.println("a:"+fucure.get());

	}

}
